$(document).ready(function() {
    $().piroBox_ext({
        piro_speed : 700,
        bg_alpha : 0.8,
        piro_scroll : true
    });

    $('#gallery').sweetPages({perPage:12, cols:4, rowHeight:230});
    var controls = $('.swControls').detach();
    controls.appendTo('#wrap');

    $('#show_upload_form').click(function(){
        elem = $('#upload_form');
        if ($(elem).is(":visible")) {
            elem.hide();
        } else {
            elem.show();
        }
        return false;
    });
});